<?php
 $timeoutseconds = 5*60; //5 minutes 
	$timestamp = time(); 
	$timeout = $timestamp-$timeoutseconds;
    $sql="SELECT * from useronline where ip='". $_SERVER['REMOTE_ADDR'] . "'" ; 
    $row = count(@mysql_fetch_array($sql));
    if($row<1) {
        $sql="INSERT INTO useronline(timestamp,ip) VALUES ('".time()."','" . $_SERVER['REMOTE_ADDR'] ."')";
        mysql_query($sql,$con);
    }
   	$sql="DELETE from useronline WHERE timestamp < " . $timeout ;
    mysql_query($sql,$con);
    $sql="SELECT * from useronline ";       
     $online_rows=count(@mysql_fetch_array($sql));    
?><!--
<table width="100%" border="0">
  <tr>
    <td  height="20" style="color:#8F6B1;font:12px/17px Arial, Helvetica, sans-serif;padding:0px;text-align:justify;">&nbsp;Online : <? echo $online_rows; ?></td>
  </tr>
  <tr>
    <td  height="20" style="color:#8F6B1;font:12px/17px Arial, Helvetica, sans-serif;padding:0px;text-align:justify;">&nbsp;Visitor : <? echo countVisitor(); ?></td>
  </tr>
</table>
-->
